﻿using Super_Management_Mayhem.Content.Spritesheet;
using Transformable_Engine_v2.Engine.Animation.ColorAnimation;
using Transformable_Engine_v2.Engine.Animation.PositionAnimation;
using Transformable_Engine_v2.Engine.Animation.RotationAnimation;
using Transformable_Engine_v2.Engine.Animation.Trajectory;
using Transformable_Engine_v2.Engine.GameObjects.Containers;
using Transformable_Engine_v2.Engine.Graphics;
using Transformable_Engine_v2.Engine.Helper;
using Transformable_Engine_v2.Engine.Transformable_Math.Geometry;

namespace Super_Management_Mayhem.Screens.Playing.Particle.RandomObjectExplosion
{
    public class Shard : ImageContainer
    {
         public Shard(int shardIndex, TE_Vector2 direction)
         {
             Sprite = ParticleSheet.GetSprite((ParticleSheet.RandomObjectShards) shardIndex);
             Origin = TE_Rectangle.Alignment.CenterMiddle;

             AddAnimations(new RotationUniformLinearAnimation(0, Randomizer.Float(-1, 1)));
             AddAnimations(new PositionUniformLinearAnimation(0, direction * Randomizer.Float(3, 5)));
             AddAnimations(new ColorAnimation(new LinearEasing(), Color.Transparent, 500, false, 0));

             Die(500);
         }
    }
}